Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  2008  Scripting  Games  Sudden  Death  Event  6  

 Content of 2008 Scripting Games Sudden Death Event 6.vbs
MD5 Hash: 09E16C50994B2EB8C6F8BAE9C7C89986
' This is my Solution for the Scripting Games 2008
' For more Information look at
' http://www.microsoft.com/technet/scriptcenter/funzone/games/games08.mspx

Option Explicit

Dim ofso : Set ofso = Createobject("Scripting.FileSystemObject")
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Call Main()

' ---------------------------------------
Sub Main()

Dim iCount
Dim arrLines
Dim vString
Dim rString()

arrLines = ReadFileToArray("C:\Scripts\lettercase.txt")

If IsArray(arrLines) then
vString = Trim(arrLines(0))
End if

ReDim rString(Len(vString) -1)
For iCount = 0 to UBound(rString)
rString(iCount) = Mid(vString,iCount +1,1)
Next

For iCount = 0 to UBound(rString)
If instrCheck("[A-Z]", rString(iCount)) then
rString(iCount) = LCase(rString(iCount))

ElseIf instrCheck("[a-z]", rString(iCount)) then
rString(iCount) = UCase(rString(iCount))

ElseIf IsNumeric(rString(iCount)) then
rString(iCount) = rString(iCount) -1
End if
Next

wscript.echo Join(rString,"")

End Sub


' ---------------------------------------
Private Function ReadFileToArray(strFile)

Dim strNextLine, arrstrList
Dim arrLines()
Dim iCount : iCount = 0

If ofso.FileExists(strFile) then

Dim oFile : Set oFile = ofso.OpenTextFile(strFile, ForReading)

Do Until oFile.AtEndOfStream

Redim Preserve arrLines(iCount)
arrLines(iCount) = oFile.ReadLine
iCount = iCount + 1

Loop

oFile.Close

End if

Set oFile = nothing

If IsArray(arrLines) then ReadFileToArray = arrLines

End Function


' ---------------------------------------
Private Function instrCheck(strPattern, strSearch)

Dim oRegEx : Set oRegEx = CreateObject("VBScript.RegExp")

Dim colMatches, strMatch
oRegEx.Global = True
oRegEx.Pattern = strPattern

Set colMatches = oRegEx.Execute(strSearch)

If colMatches.Count > 0 Then
instrCheck = true
Else
instrCheck = false
End if

End Function



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a